package com.pureut.storage.mapper;

import com.pureut.storage.domain.PickingPurchaseDetail;
import com.pureut.storage.domain.WmsStockInfo;
import com.pureut.storage.dto.*;
import com.pureut.storage.vo.WarehouseVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

/**
 * @Author: YSL
 * @Date: 2023/5/4 10:44
 * @Desc: 仓库看板
 */
@Mapper
public interface WarehouseSignageMapper {


    /**
     * 仓库信息List
     *
     * @param warehouseCode
     * @return
     */
    List<WarehouseSignageDto> getWarehouseBulletinBoard(String warehouseCode);

    /**
     * 仓库信息
     *
     * @param warehouseCode
     * @return
     */
    WarehouseSignageDto getWarehouseBulletinBoardInfo(String warehouseCode);

    /**
     * 库存信息
     *
     * @param warehouseCode
     * @return
     */
    List<WmsStockInfo> selectWarehouseBulletinList(Long warehouseCode);

    /*----------------------- 出库数 ------------------------*/

    /**
     * 生产领料（累积出库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getNewStockInfoDetailNumber(String warehouseName);

    /**
     * 委外发货（累积出库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getPickingOutsourceDetailNumber(String warehouseName);

    /**
     * 销售发货（累积出库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getPickingSaleDetailNumber(String warehouseName);

    /**
     * 返工出库（累积出库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getPickingCompleteDetailNumber(String warehouseName);

    /**
     * 采购退货（累积出库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getPickingPurchaseDetailNumber(String warehouseName);

    /**
     * 委外退货（累积出库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getPickingReturnsDetailNumber(String warehouseName);

    /**
     * 其他出库（累积出库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getPickingRestDetailNumber(String warehouseName);

    /*----------------------- 入库库数 ------------------------*/

    /**
     * 采购入库（累积入库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getPurchaseReceiptDetailNumber(String warehouseName);

    /**
     * 销售退货（累积入库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getSalesReturnDetailNumber(String warehouseName);

    /**
     * 生产退料（累积入库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getProductionMaterialReturnDetailNumber(String warehouseName);

    /**
     * 完工入库（累积入库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getWipCompletionDetailNumber(String warehouseName);

    /**
     * 其他入库（累积入库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getMiscellaneousReceiptDetailNumber(String warehouseName);

    /**
     * 委外入库（累积入库数量）
     *
     * @param warehouseName
     * @return
     */
    WarehouseInventorySituationDto getSubcontractReceiptDetailNumber(String warehouseName);

    /**
     * 查询当前库存内数量
     * @param wsiWarehourse
     * @return
     */
    WarehouseInventorySituationDto selectWmsStockInfoNumber(Long wsiWarehourse);



    /*----------------------- 仓库库存情况 库存量（吨） ------------------------*/

    /**
     * 查询库存量
     *
     * @param warehouseId
     * @return
     */
    List<WarehouseInventoryDto> selectWarehouseInventory(@Param("warehouseId") Long warehouseId);

    /*----------------------- 本月物料出库统计 ------------------------*/

    /**
     * 每月类别出库数量（生产领料）
     *
     * @param outOfStock
     * @return
     */
    Long monthlyStockInfoDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别出库数量（委外发货）
     *
     * @param outOfStock
     * @return
     */
    Long monthlyPickingOutsourceDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别出库数量（销售发货）
     *
     * @param outOfStock
     * @return
     */
    Long monthlyPickingSaleDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别出库数量（返工出库）
     *
     * @param outOfStock
     * @return
     */
    Long monthlyPickingCompleteDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别出库数量（采购退货）
     *
     * @param warehouseName
     * @return
     */
    Long monthlyPickingPurchaseDetailListNumber(@Param("warehouseName") String warehouseName, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别出库数量（委外退货）
     *
     * @param warehouseName
     * @return
     */
    Long monthlyPickingReturnsDetailListNumber(@Param("warehouseName") String warehouseName, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别出库数量（其他出库）
     *
     * @param outOfStock
     * @return
     */
    Long monthlyPickingRestDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /*----------------------- 本月物料入库统计 ------------------------*/

    /**
     * 每月类别入库数量（采购入库）
     *
     * @param outOfStock
     * @return
     */
    Long warehousingPurchaseReceiptDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别入库数量（销售退货）
     *
     * @param outOfStock
     * @return
     */
    Long warehousingSalesReturnDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别入库数量（生产退料）
     *
     * @param outOfStock
     * @return
     */
    Long warehousingProductionMaterialReturnDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别入库数量（完工入库）
     *
     * @param outOfStock
     * @return
     */
    Long warehousingWipCompletionDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别入库数量（其他入库）
     *
     * @param outOfStock
     * @return
     */
    Long warehousingMiscellaneousReceiptDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 每月类别入库数量（委外入库）
     *
     * @param outOfStock
     * @return
     */
    Long warehousingSubcontractReceiptDetailNumber(@Param("outOfStock") Long outOfStock, @Param("materialType") Long materialType, @Param("startTime") String startTime, @Param("endTime") String endTime);

    /*----------------------- 库区物料情况 ------------------------*/

    /**
     * 库区物料情况
     *
     * @param warehouseCode
     * @return
     */
    List<WarehouseMaterialsSituationDto> getWarehouseMaterialsSituationList(Long warehouseCode);

    /*----------------------- 近七天库存周转率 ------------------------*/

    /**
     * 查询期初库存数量
     *
     * @param openingDate, warehouseCode
     * @return
     */
    Long getOpeningInventoryNumber(@Param("openingDate") String openingDate, @Param("warehouseCode") Long warehouseCode);

    /**
     * 查询期末库存数量
     *
     * @param openingDate
     * @param endingDate
     * @return
     */
    Long getEndingInventoryNumber(@Param("openingDate") LocalDate openingDate, @Param("endingDate") LocalDate endingDate, @Param("warehouseCode") Long warehouseCode);

    /**
     * 生产领料
     *
     * @param openingDate
     * @param endingDate
     * @param warehouseCode
     * @return
     */
    Long getPeriodTimeNewStockInfoNumber(@Param("openingDate") LocalDate openingDate, @Param("endingDate") LocalDate endingDate, @Param("warehouseCode") Long warehouseCode);

    /**
     * 委外发货
     *
     * @param openingDate
     * @param endingDate
     * @param warehouseCode
     * @return
     */
    Long getPeriodTimePickingOutsourceNumber(@Param("openingDate") LocalDate openingDate, @Param("endingDate") LocalDate endingDate, @Param("warehouseCode") Long warehouseCode);

    /**
     * 销售发货
     *
     * @param openingDate
     * @param endingDate
     * @param warehouseCode
     * @return
     */
    Long getPeriodTimePickingSaleNumber(@Param("openingDate") LocalDate openingDate, @Param("endingDate") LocalDate endingDate, @Param("warehouseCode") Long warehouseCode);

    /**
     * 返工出库
     *
     * @param openingDate
     * @param endingDate
     * @param warehouseCode
     * @return
     */
    Long getPeriodTimePickingCompleteNumber(@Param("openingDate") LocalDate openingDate, @Param("endingDate") LocalDate endingDate, @Param("warehouseCode") Long warehouseCode);

    /**
     * 采购退货
     *
     * @param openingDate
     * @param endingDate
     * @param warehouseName
     * @return
     */
    Long getPeriodTimePickingPurchaseNumber(@Param("openingDate") LocalDate openingDate, @Param("endingDate") LocalDate endingDate, @Param("warehouseName") String warehouseName);

    /**
     * 委外退货
     *
     * @param openingDate
     * @param endingDate
     * @param warehouseName
     * @return
     */
    Long getPeriodTimePickingReturnsNumber(@Param("openingDate") LocalDate openingDate, @Param("endingDate") LocalDate endingDate, @Param("warehouseName") String warehouseName);


    /**
     * 其他出库
     *
     * @param openingDate
     * @param endingDate
     * @param warehouseCode
     * @return
     */
    Long getPeriodTimePickingRestNumber(@Param("openingDate") LocalDate openingDate, @Param("endingDate") LocalDate endingDate, @Param("warehouseCode") Long warehouseCode);

    /**
     * 获取最小库存数
     *
     * @param warehouseCode
     * @param wsiMaterialCode
     * @return
     */
    Long getInventoryQuantityNumber(@Param("warehouseCode") Long warehouseCode, @Param("wsiMaterialCode") String wsiMaterialCode);

    /**
     * 告警内容
     * @param warehouseCode
     * @return
     */
    List<AlarmContentDto> getAlarmContentDtoList(@Param("warehouseCode") Long warehouseCode, @Param("wsiMaterialCode") String wsiMaterialCode);
}
